﻿namespace Ord.Api.Services
{
    /// <summary>
    /// 订单管理
    /// </summary>
    public interface IOrderAppService : IAppService
    {
        [OperateLog(LogName = "订单创建")]
        [UnitOfWork(SharedToCap = true)]
        Task<OrderVo> CreateAsync(OrderCreationDto input);

        [OperateLog(LogName = "调整订单状态")]
        [UnitOfWork]
        Task MarkCreatedStatusAsync(WarehouseQtyBlockedEvent eventDto, IMessageTracker tracker);

        [OperateLog(LogName = "订单付款")]
        [UnitOfWork(SharedToCap = true)]
        Task<OrderVo> PayAsync(long id);

        [OperateLog(LogName = "订单更新")]
        Task<OrderVo> UpdateAsync(long id, OrderUpdationDto input);

        [OperateLog(LogName = "订单取消")]
        [UnitOfWork(SharedToCap = true)]
        Task<OrderVo> CancelAsync(long id);

        [OperateLog(LogName = "订单删除")]
        Task DeleteAsync(long id);
        [OperateLog(LogName = "订单搜索")]
        Task<PageModelVo<OrderVo>> GetPagedAsync(OrderSearchPagedDto search);

        [OperateLog(LogName = "订单详情")]
        Task<OrderVo> GetAsync(long id);
    }
}
